package com.serviceprovider.business.module.sp.transaction.services.dao.interfaces;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.common.Page;
import com.serviceprovider.business.module.sp.transaction.model.Batch;
import com.serviceprovider.business.module.sp.transaction.model.TransactionDetail;
import com.serviceprovider.business.module.sp.transaction.model.TransactionUserAmount;
import com.serviceprovider.business.module.user.model.impl.User;

//~--- JDK imports ------------------------------------------------------------

import java.util.List;
import java.util.Map;

/**
 * @author mrduongnv@gmail.com
 *
 */
public interface ITransactionUserAmountDao {

    /**
     * Insert TransactionUserAmount
     */
    TransactionUserAmount insert(TransactionUserAmount transUserAmount);

    /**
     * Delete a TransactionUserAmount
     */
    void delete(int id);

    /**
     * Update TransactionUserAmount
     */
    void update(TransactionUserAmount transactionUserAmount);

    /**
     * Return the TransactionUserAmount by it's ID
     */
    TransactionUserAmount getById(int id);

    /**
     * Pagination of TransactionUserAmount
     */
    Page<TransactionUserAmount> find(int pageNumber, int pageSize, String sortColumn, String sortOrder);

    /**
     * Return the list Payees of service provider
     */
    List<User> findPayeesOfProvider(Integer providerId);

    /**
     * Return the total of the list transaction
     */
    Map<Integer, Integer> calculateTotalAmount(List<Integer> transactionId);

    /**
     * Return the list of TransactionUserAmount by Batch & TransactionDetail
     */
    List<TransactionUserAmount> findByTransactionDetail(Batch batch, TransactionDetail trans);

    /**
     * Delete TransactionUserAmount by batch's ID
     */
    void deleteByBatchId(Integer batchId);

    void deleteByBatchId(List<Integer> deletedBatchId);

    List<TransactionUserAmount> findTransactionUserAmountByTransactionId(int transactionId);

    public TransactionUserAmount findPayeeByIds(int transactionId, int payeeUserId);

    public void updateAll(TransactionDetail transactionDetail);

    public void deleteAllByTransactionId(Integer transactionId);
}



